<!DOCTYPE html>
<html lang="zh">
<head>
    <meta charset="UTF-8">
    <title>ceShiSetData</title>



</head>
<body>
<script type="text/javascript">

    window.onload=function () {
        /**
         此牛逼玩意儿赋予我们一个崭新的东西,就是
         调参与复制分离,
         * */

        function fuck(ob) {
            ob.cao1();
            ob.cao();
        }
        fuck({
            data:{
                k:"1",
                k2:"k2",
            },
            /**
             *设置setData,让数据增加变得简单
             * */
            setData:function(ob){
                var keys = Object.keys(ob);
                for(var i=0;i<keys.length;i++){
                    this.data[keys[i]]=ob[keys[i]];
                }

            },
            cao:function () {
                alert(JSON.stringify(this.data));
            },
            cao1:function () {
                this.setData({k3:'123123',k4:'卧槽尼玛'});
            }
        });








    }








</script>
</body>
</html>